-
-
Notifications
You must be signed in to change notification settings - Fork 15
disable fs for browser build #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
just like PostCSS does: https://github.com/postcss/postcss/blob/master/package.json#L71
You can solve this in webpack by setting node: {
fs: "empty"
} |
I know, I was doing this before PostCSS 6, but don't you think it's better to declare this in the project instead of everyone's webpack config ? Would save people's time in my opinion. |
It's only easier if the whole dependency tree of your webpack bundle uses this field (and if they don't, you still have to define |
I don't understand why it is such a big deal to add this field in package.json, anyway I will do it in my webpack config. |
So why not adding this field in all modules from npm? |
To me it feels like a really bad way of fixing some behaviour. npm has hundreds of thousands of modules, why do we have to update them all when we could update webpack itself to handle the most common case? |
Some modules have a hard requirement for |
OK. Then I will reconsider this pull request on the condition that we add in a unit test for this behaviour; perhaps we might be able to swap out |
I don't know what kind of unit test you expect here. It is not trivial to detect if one of the project dependencies uses |
I think having some kind of webpack bundle test would be sufficient, to make sure that the module compiled OK and that there were no errors thrown. We do this for cssnano: https://github.com/ben-eb/cssnano/blob/master/src/__tests__/webpack.js |
This is a huge dependency for such a simple change. I don't think it's worth it. |
just like PostCSS does: https://github.com/postcss/postcss/blob/master/package.json#L71